{ Russian Olympiad. 1 stage.
  Problemset: http://agul-problems1.googlecode.com/svn/trunk/2010-2011/roi/stage1/roi_1stage.doc
  Problem 1
  Points: 16
}
program z1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var i,n:longint;
    speed,step,num:array[1..100000] of longint;
    time:array[1..100000] of int64;
    x:int64;

  procedure qsort(s,e:longint);
  var m,i,j,x:longint;
  begin
    m:=step[(s+e) div 2];
    i:=s;
    j:=e;
    repeat
      while step[i]<m do inc(i);
      while step[j]>m do dec(j);
      if i<=j then begin
        x:=step[i];
        step[i]:=step[j];
        step[j]:=x;
        x:=speed[i];
        speed[i]:=speed[j];
        speed[j]:=x;
        x:=num[i];
        num[i]:=num[j];
        num[j]:=x;
        inc(i);
        dec(j);
      end;
    until i>j;
    if i<e then qsort(i,e);
    if j>s then qsort(s,j);
  end;


begin
  assign(input,'input.txt');
  assign(output,'output.txt');
  reset(input);
  rewrite(output);
  readln(n);
  for i:=1 to n do begin
    readln(speed[i], step[i]);
    num[i]:=i;
  end;
  qsort(1,n);
  time[num[1]]:=speed[1]* step[1];
  for i := 2 to n do begin
    x:=speed[i]*step[i];
    if x<time[num[i-1]] then
      time[num[i]]:=time[num[i-1]]
    else time[num[i]]:=x;
  end;
  for i:=1 to n do writeln(time[i]);
  close(input);
  close(output);
end.